// 线样式枚举
const lineTypeEnum = [
  { key: '__________', value: 'solid' },
  { key: '----------', value: 'dashed' },
  { key: '................', value: 'dotted' },
];
// 线条粗细
function lineType(params) {
  const { name, value } = params || {};
  return {
    name: name || '样式',
    code: 'type',
    value: value || 'solid',
    type: 'Select',
    enumValue: lineTypeEnum,
  };
}
export default {
  name: '圈选层',
  code: 'custom_map_group_select',
  version: '1.0.0',
  config: [
    {
      name: '圆形圈选',
      code: 'circle',
      children: [
        {
          name: '背景颜色',
          code: 'bgColor',
          value: 'rgba(108, 84, 232, 0.3)',
          type: 'ColorSelector',
        },
        {
          name: '边框颜色',
          code: 'lineColor',
          value: '#018CFF',
          type: 'ColorSelector',
        },
        {
          name: '边框宽度(1~99)',
          code: 'lineWidth',
          value: 3,
          min: 1,
          max: 10,
          type: 'InputNumber',
          unit: 'px',
        },
        lineType(),
      ],
    },
    {
      name: '矩形圈选',
      code: 'rectangle',
      children: [
        {
          name: '背景颜色',
          code: 'bgColor',
          value: '#6c54e8',
          type: 'ColorSelector',
        },
        {
          name: '边框颜色',
          code: 'lineColor',
          value: '#018CFF',
          type: 'ColorSelector',
        },
        {
          name: '边框宽度(1~99)',
          code: 'lineWidth',
          value: 3,
          min: 1,
          max: 10,
          type: 'InputNumber',
          unit: 'px',
        },
      ],
    },
    {
      name: '按钮样式',
      code: 'btn',
      children: [
        {
          name: '文本设置',
          code: 'font',
          value: {
            fontSize: 16,
            fontFamily: 'siyuan',
            color: '#FFF',
            fontWeight: 'normal',
          },
          type: 'FontGroup',
        },
        {
          name: '上边距',
          code: 'top',
          value: 12,
          min: 0,
          type: 'InputNumber',
          unit: 'px',
        },
        {
          name: '右边距',
          code: 'right',
          value: 140,
          min: 0,
          type: 'InputNumber',
          unit: 'px',
        },
        {
          name: '背景颜色',
          code: 'backgroundColor',
          value: 'rgba(85, 85, 85, 0.6)',
          type: 'ColorSelector',
        },
      ],
    },
    {
      name: '清除按钮样式',
      code: 'clearAll',
      children: [
        {
          name: '文本设置',
          code: 'clearFont',
          value: {
            fontSize: 20,
            fontFamily: 'siyuan',
            color: '#FFF',
            fontWeight: 'normal',
          },
          type: 'FontGroup',
        },
        {
          name: '上边距',
          code: 'clearTop',
          value: 12,
          min: 0,
          type: 'InputNumber',
          unit: 'px',
        },
        {
          name: '右边距',
          code: 'clearRight',
          value: 10,
          min: 0,
          type: 'InputNumber',
          unit: 'px',
        },
        {
          name: '背景颜色',
          code: 'clearBgColor',
          value: 'rgba(85, 85, 85, 0.6)',
          type: 'ColorSelector',
        },
      ],
    },
  ],
  data: {},
  events: {
    click: {
      description: '标签点击响应事件',
      fields: {
        selectParam: {
          mapper: '',
          value: '',
        },
      },
      action: {
        active: false,
      },
    },
  },
};
